const mongoose = require("mongoose");
const { mongoDBPath } = require("../config/config.default");

const main = () => {
  mongoose
    .connect(mongoDBPath)
    .then(() => console.log("mongoDB Connected Successful !"))
    .catch(err=> console.log('mongoDB Connected Failed' + err))
}

main() //启动mongoDB服务

module.exports = {
    User:mongoose.model('User',require('./userModel')),
    Subscribe:mongoose.model('Subscribe',require('./subscribeModel')),
}
